<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="content" type="text/html" charset="utf-8" />
		<title>user</title>
		<link rel="stylesheet" style="text/css" href="<{$res}>/css/user.css" />
		<script src="<{$res}>/js/jquery.js"></script>
        <script src="<{$res}>/js/user.js"></script>
        <script src="<{$res}>/js/review.js"></script>
        <script src="<{$res}>/js/ajax3.0.js"></script>
	</head>
	<body>
		<div class="user_content">
			<form action="#" method="post">
			<!--操作表单部分-->
			<div class="user_content_action">
				<!--左边表单部分-->
				<div class="user_content_action_left">
					<!--标题部分-->
					<div class="user_content_action_left_title">
						<div class="user_content_action_left_title_icon"></div><span>用户</span>
					</div>
					<!--链接部分-->
					<div class="user_content_action_left_link">
						<a href="#">全部(1)</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">已封号(0)</a>
					</div>
					<!--批量操作表单部分-->
					<div class="user_content_action_left_form">
						<div class="user_content_action_left_form_select">
								<select>
									<option selected>选择年份</option>
									<option>2012</option>
									<option>2011</option>
								</select>
								<select>
									<option selected>选择月份</option>
									<option>01</option>
									<option>02</option>
								</select>
						</div>
						<div class="user_content_action_left_form_button">
							<input id="user_content_action_left_form_button" type="button" name="button" value="应用">
                        </div>
                         <label for="checkbox"><input type="checkbox" name="" class="checked" id="checkbox" /><a href="#" id="all">全选</a></label>/<a href="#" id="not">反选</a>
                    　<a href="" onclick="review_delete(this)" title="删除"><img src="<{$res}>/images/delete.gif"></a>
					</div>
				</div>
				<!--右边搜索部分-->
				<div class="user_content_action_right">
					<div class="user_content_action_right_form">
						<div class="user_content_action_right_form_text">
							<input id="user_content_action_right_form_text" type="text" name="text" value="" />
						</div>
						<div class="user_content_action_right_form_button">
							<input id="user_content_action_right_form_button" type="button" name="button" value="搜索" />
						</div>
						<span>3个用户</span>
					</div>
				</div>
			</div>
			<!--用户列表部分-->
                        <div class="user_content_list">
                                <table cellspacing="0" border="0">
                                        <div style="width:100%;height:100px;float:left;display:none;" class="slide"></div>
					<tr>
						<th style="text-align:center;">
							<input class="checkbox" type="checkbox" name="id[]" value="" />
						</th>
						<th>用户名</th>
						<th>博客名称</th>
						<th>电子邮件</th>
						<th>状态</th>
						<th style="text-align:center;">发表</th>
                                        </tr>
                                        <{section loop=$data name="ls"}>
                                        <tr class="user_content_list_tr hh<{$data[ls].u_id}>">
						<!--复选框部分-->
						<td class="user_content_list_checkbox">
								<input type="checkbox" name="id[]" value="" />
						</td>
						<!--用户名-->
						<td class="user_content_list_username">
                                                        <div class="user_content_list_info u_name<{$data[ls].u_id}>">
                                                                <img src="<{$root}>/upload/littleico/<{$data[ls].u_ico}>" title="图片" width="38px" height="38px"/>
                                                                <tt><{$data[ls].u_name}></tt>
							</div>
							<div class="user_content_list_action">
                                                                <div class="user_content_list_ac"><a href="javascript:deletes('<{$data[ls].u_id}>')">删除</a> | <a href="javascript:mod('<{$data[ls].u_id}>','<{$data[ls].u_name}>','<{$data[ls].blogname}>','<{$data[ls].email}>','<{$data[ls].info}>','<{$data[ls].u_ico}>')">编辑</a>  |  <a href="javascript:send('<{$data[ls].u_id}>','<{$data[ls].u_name}>','<{$data[ls].u_ico}>');">发消息</a></div>
							</div>
						</td>
						<!--博客名称-->
						<td class="user_content_list_blogname blogname<{$data[ls].u_id}>">
							<{$data[ls].blogname}>
						</td>
						<!--电子邮件-->
						<td class="user_content_list_email email<{$data[ls].u_id}>">
                                                        <{$data[ls].email}>
						</td>
						<!--状态-->
                                                <td class="user_content_list_statu">
                                                        <{if $data[ls].status eq 0 }>
                                                        <a href="javascript:;" onclick="shield(this,'<{$data[ls].u_id}>')" class="shield<{$data[ls].u_id}>">可登陆</a>
                                                        <{else}>
                                                        <a href="javascript:;" onclick="shield(this,'<{$data[ls].u_id}>')" class="shield<{$data[ls].u_id}>">不可登陆</a>
                                                        <{/if}>
						</td>
						<!--发表-->
						<td class="user_content_list_publish">
							10
						</td>
                                        </tr>
                                        <{/section}>
                                </table>
			</div>
		</form>
			<!--分页-->
			<span style="text-align:center;"><{$fpage}></span>
		</div>
        </body>
        <script src="<{$res}>/js/review.js"></script>
        <script type="text/javascript" charset="utf-8">
                function shield(obj , u_id) {
                        var obj=obj;
                        var u_id=u_id;
                        if($(".shield"+u_id).html() == "可登陆"){ 
                                $(".shield"+u_id).html('不可登陆');
					var url = '<{$url}>/shield/u_id/'+u_id+'/status/0';
					Ajax().get(url,function(data){
					});	
                        }else if($(".shield"+u_id).html() == "不可登陆"){
                                $(".shield"+u_id).html('可登陆');
				        var url = '<{$url}>/shield/u_id/'+u_id+'/status/1';
					Ajax().get(url,function(data){						
					});	
			}
                }
                function deletes(u_id) {
                        if(confirm("确认删除？")){   
                        Ajax().get("<{$url}>/deletes/u_id/"+u_id,function(data){
                                $('.hh'+u_id).remove();
                        });
                        }
                }
function mod(u_id,u_name,blogname,email,info,u_ico){
        $(".slide").html('<div class="mod"><b>修改用户</b></div><div class="mod1"><form><img src="<{$root}>/upload/littleico/'+u_ico+'">用户名:<input type="text" id="u_name" size="15" value="'+u_name+'">邮箱:<input type="text" id="email" size="15" value="'+email+'">密码:<input size="15" type="text" id="password" value="">博客信息:<input type="text" id="info" value="'+info+'"><input type="button" onclick="mod1('+u_id+')" value="修改"></form></div>');
                
        $(".slide").slideDown("slow");
}
function send(u_id,u_name,u_ico){
        $(".slide").html('<div class="send"><b>发送私信</b></div><div class="send1">接收者:<img src="<{$root}>/upload/littleico/'+u_ico+'">'+u_name+';内容:<form action="<{$url}>/send"><input type="text" size="100" name="contet" value=""><input type="submit" name="sub" value="发送"></form></div>');
                
        $(".slide").slideDown("slow");
}

function mod1(id){
        var u_name=document.getElementById('u_name').value;
        var password=document.getElementById('password').value;
        var email=document.getElementById('email').value;
        var info=document.getElementById('info').value;
        var mess={u_id:id,u_name:u_name,password:password,email:email,info:info};
        $(".u_name"+id).children("tt").html(u_name);
        $(".email"+id).html(email);
        $(".info"+id).html(info);
        $(".slide").slideUp("slow");

        Ajax().post('<{$url}>/mod',mess,function(data){

                        });
}
        </script>
</html>
